package com.shangguigu.spirngioc.ioc.factory;

import com.shangguigu.spirngioc.ioc.bean.Car;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component
public class BYD implements FactoryBean<Car> {
    //返回bean
    @Override
    public Car getObject() throws Exception {
        System.out.println("byd工厂造出来车");
        Car car =new Car();
        return car;
    }

    //返回bean的类型
    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }


    //true为单例
    //false为多例
    @Override
    public boolean isSingleton() {
        return false;
    }
}
